/*
 * @Description: 常量
 * @Author: HuiSir<https://gitee.com/huisir001>
 * @Date: 2025-08-08 10:17:34
 * @LastEditTime: 2025-08-25 09:14:58
 */

/**
 * 正则表达式
 */
export const REG_EXP_PATTERN = {
  mobile: /^1[3-9]\d{9}$/,
  url: /^https?:\/\/(?:(?:\d{1,3}\.){3}\d{1,3}|(?:[\w\u00a1-\uffff.-]+\.[a-z]{2,}))(?::\d+)?(?:\/[^\s?#]*)?(\?[^\s#]*)?$/i,
  email: /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/,
};

/**
 * 文件常见mimetype对照表
 */
export const MIME_TYPE: Record<string, string> = {
  ".txt": "text/plain",
  ".ttf": "font/ttf",
  ".html": "text/html",
  ".htm": "text/html",
  ".jsp": "text/html",
  ".asp": "text/asp",
  ".php": "text/x-php",
  ".css": "text/css",
  ".js": "application/javascript",
  ".json": "text/json",
  ".pdf": "application/pdf",
  ".doc": "application/msword",
  ".dot": "application/msword",
  ".docx":
    "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
  ".jpg": "image/jpeg",
  ".jpeg": "image/jpeg",
  ".jfif": "image/jpeg",
  ".png": "image/png",
  ".gif": "image/gif",
  ".bmp": "image/x-ms-bmp",
  ".tiff": "image/tiff",
  ".svg": "text/xml",
  ".webp": "image/webp",
  ".xml": "text/xml",
  ".mp4": "video/mpeg4",
  ".webm": "video/webm",
  ".3gp": "video/3gpp",
  ".mp3": "audio/mpeg",
  ".xls": "application/vnd.ms-excel",
  ".xlsx": "application/vnd.ms-excel",
  ".ico": "image/x-icon",
  ".java": "java/*",
  ".jar": "application/java-archive",
  ".zip": "application/zip",
  ".gz": "application/gzip",
  ".rar": "application/octet-stream",
  ".tgz": "application/tgz",
  ".7z": "application/x-7z-compressed",
  ".tar": "application/x-tar",
  ".sh": "application/x-sh",
};
